import React, { Component } from 'react';

import styles from './home.module.less'

import { Upload, message, Button } from 'antd';
import { UploadOutlined } from '@ant-design/icons';

let propsInfo = {
  name: 'file',
  action: 'http://192.168.0.105:3000/api/upload',
  onChange(info) {
    if (info.file.status !== 'uploading') {
      // message.success("上传成功");
    }
    if (info.file.status === 'done') {
      message.success(`${info.file.name} file 上传成功`);
    } else if (info.file.status === 'error') {
      message.error(`${info.file.name} file 上传失败`);
    }
  },
};

class home extends Component {
  constructor(){
    super()
    this.state={
      fileList:[]
    }
  }
  render() {
    return (
      <div className={styles.container}>
        <Upload {...propsInfo}>
            <Button icon={<UploadOutlined />}>点击上传文件</Button>
        </Upload>
      </div>
    );
  }
}


export default home;